
import { BasicColumn, FormSchema } from '/@/components/Table';
import { UploadBizType } from '/@/enums/uploadEnum';
import { render } from '/@/utils/common/renderUtils';
import { rules } from '/@/utils/helper/validator';

export const tenantFormSchema: FormSchema[] = [
  {
    field: 'baseDivider',
    label: "基础设置",
    component: "Divider"
  },
  {
    label: '图标',
    field: 'logo',
    component: 'MyImageUpload',
    componentProps: {
      fileMax:1,
      bizType: UploadBizType.GENERAL_IMAGE
    },
  },
  {
    field: 'tenantId',
    label: '租户编号',
    component: 'Input',
    dynamicDisabled: true,
  },
  {
    field: 'name',
    label: '租户名称',
    component: 'Input',
  },
  
  {
    field: 'siteDescTitle',
    label: '描述标题',
    component: 'Input',
  },
  {
    label: '描述内容',
    field: 'siteDescContent',
    helpMessage: '用于租户网站门面的描述',
    component: 'InputTextArea',
    componentProps: {
      placeholder: '请输入站点描述',
      rows: 3,
    },
  },

  {
    label: '备注',
    field: 'remark',
    component: 'InputTextArea',
    componentProps: {
      placeholder: '请输入备注',
      rows: 3,
    },
  },
  {
    field: 'functionDivider',
    label: "功能设置",
    component: "Divider"
  },
  {
    field: 'emailSenderName',
    helpMessage: '接收邮件人显示的对方姓名',
    label: '邮件发送者',
    component: 'Input',
  },
  {
    field: 'enabledEmailConfigKey',
    label: "邮件渠道",
    component: "JDictSelectTag",
    componentProps: {
      type: 'radio',
      dictCode: 'email_channel',
    },
  },
  {
    field: 'enabledSmsConfigKey',
    label: "短信渠道",
    component: "JDictSelectTag",
    componentProps: {
      type: 'radio',
      dictCode: 'sms_channel',
    },
  },

  {
    field: 'baseDivider',
    label: "默认图片",
    component: "Divider"
  },

  {
    label: '默认头像',
    field: 'defaultHeadImg',
    component: 'MyImageUpload',
    componentProps: {
      fileMax:1,
      bizType: UploadBizType.GENERAL_IMAGE
    },
  },
  {
    field: 'domainDivider',
    label: "域名设置设置",
    component: "Divider"
  },

  {
    field: 'h5Url',
    label: 'H5域名',
    component: 'Input',
  },
];

export const tradeFormSchema: FormSchema[] = [
  {
    field: 'payModel',
    label: '支付模式',
    component: "JDictSelectTag",
    defaultValue: '2',
    componentProps: {
      type: 'radio',
      dictCode: 'pay_model',
    },
  },

  {
    field: 'closeTime',
    label: "未支付订单",
    component: "InputNumber",
    helpMessage: '如果在期间订单未付款，系统自动关闭',
    componentProps: {
      min: 1,
      defaultValue: 1,
      addonAfter: '分钟后自动关闭'
    }
  },
  {
    field: 'payGatewayUrl',
    label: "支付网关地址",
    rules: rules.rule('http', false),
    component: "Input",
    helpMessage: [
      '用于第三方回调统一支付服务、生成支付二维码链接',
      '示例: https://www.demo.com/pay-service'
    ],
  },
  
];


export const copyrightFormSchema: FormSchema[] = [
  {
    field: 'beiAnDivider',
    label: "网站备案",
    component: "Divider"
  },
  {
    field: 'icp',
    label: '网站ICP备案号',
    component: 'Input',
  },

  {
    field: 'govRecord',
    label: '网站公安备案',
    component: 'Input',
  },

  {
    field: 'govUrl',
    label: '网站公安链接',
    component: 'Input',
  },

  {
    field: 'marketSupervisionUrl',
    label: '监督管理局链接',
    component: 'Input',
  }
];

